package cn.sxt.clinic.mapper;

import cn.sxt.clinic.pojo.CaseOrderTmpTwo;
import cn.sxt.clinic.pojo.PrescriptionSurcharge;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ${author}
 * @since 2020-07-02
 */
public interface CaseOrderTmpTwoMapper extends BaseMapper<CaseOrderTmpTwo> {

    @Select("select p.*,d.dictionary_name surchargeTypeName,d2.dictionary_name typeName from t_case_order_tmp_two p LEFT JOIN t_dictionary d \n" +
            "ON p.dictionary_id = d.dictionary_id LEFT JOIN t_dictionary d2 ON p.surcharge_type_id = d2.dictionary_id  ${ew.customSqlSegment}")
    List<CaseOrderTmpTwo> selectCaseOrderTmpTwo(@Param(Constants.WRAPPER) QueryWrapper wrapper);

}
